{include file="../_meta" /}

<body style="padding:0px;">
<!-- 添加用户窗口-->
<style>
	form {
		padding:20px 40px;
	}
	form div {
		margin-bottom:10px;
	}
	input {
		width:316px;
	}
</style>

<!-- 添加用户认证窗口-->
<form id="ff-train" class="easyui-form" method="post" data-options="novalidate:true">
	<input type="hidden" id="train-eno" name="employee_id" value="{$id}" />
	
	<div>
		<input class="easyui-textbox" name="train_position" data-options="label:'培训岗位:',required:true,prompt:'请输入培训岗位',missingMessage:'必填项'">
	</div>
	
	<div>
		<input class="easyui-datebox" text="text" name="train_date" label="培训日期:"  data-options="formatter:myformatter,parser:myparser,required:true,panelWidth:220,prompt:'请选择培训日期',missingMessage:'必填项'">
	</div>
		
	<div>
		<input class="easyui-datebox" text="text" name="evaluation_date" label="考核日期:"  data-options="formatter:myformatter,parser:myparser,required:true,panelWidth:220,prompt:'请选择考核日期',missingMessage:'必填项'">
	</div>
	
	<div>
		<input class="easyui-datebox" text="text" name="valid_date" label="有效日期:"  data-options="formatter:myformatter,parser:myparser,required:true,panelWidth:220,prompt:'请选择有效日期',missingMessage:'必填项'">
	</div>			
	
	<div>
		<input class="easyui-textbox" name="memo" style="height:100px;" data-options="multiline:true,label:'备&emsp;&emsp;注:'">
	</div>
</form>
<div style="text-align:center;">
	<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveUserTrain();" style="margin-right:30px;">保存</a>
	<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:parent.$('#dlg-train').dialog('close');">取消</a>
</div>	
	
<script type="text/javascript">
// 保存用户认证信息
function saveUserTrain() {
	$('#ff-train').form('submit',{
		url: "employeeSaveTrain",
		onSubmit: function(){
			return $(this).form('enableValidation').form('validate');
		},
		success: function(result){			
			var result = eval('('+result+')');
			if (result.errorMsg){
				parent.$.messager.show({
					title: 'Error',
					msg: result.errorMsg
				});
			} else {
				parent.$.messager.show({
					title: 'Success',
					msg: "添加成功"
				});
				parent.$('#dlg-train').dialog('close');		// close the dialog
				parent.$('#easyui_dg').datagrid('reload');	// reload the user data	
			}
		}
	});
};
</script>			
</body>
</html>